import React from 'react';
import DatePickerSheetIOS from './Modal'

export default class PickerProvider extends  React.Component {

    static propTypes = {
        children:React.PropTypes.any,
        // onDateChange: React.PropTypes.func,
        // mode: React.PropTypes.oneOf(['date', 'datetime', 'time']),
        // date: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.instanceOf(Date)]),
        // minDate: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.instanceOf(Date)]),
        // maxDate: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.instanceOf(Date)]),
        // format: React.PropTypes.string
    };



    static  childContextTypes = {
        showPickerController:React.PropTypes.func,
    };

    getChildContext() {
        return {showPickerController: (...args) => this._pickerRef.showPickerController(...args)}
    };




    render() {

        return (
            <DatePickerSheetIOS ref={ component => this._pickerRef = component}
             // onDateChange={(dateStr, date) => this.props.onDateChange(dateStr, date)}
             //                     mode={ this.props.mode}
             //                     date={this.props.date}
             //                     minDate={this.props.date}
             //                     maxDate={this.props.maxDate}
             //                     format={this.props.format}
            >
                {React.Children.only(this.props.children)}
            </DatePickerSheetIOS>
        )

    }







}
